package com.gr.catanddog_common.utils;

import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.Random;

/**
 * @author 大睡大唬
 * @version 1.0
 * @description: TODO
 * @date 2024/3/5 15:02
 */
@Component
@Data
public class RandomUtil {
    public static String produceCode(){
        StringBuilder code = new StringBuilder();
        Random random = new Random();
        for(int i=0;i<6;i++){
            int i1 = random.nextInt(0, 9);
            code.append(i1);
        }
        return code.toString();
    }

    public static void main(String[] args) {
        System.out.println(RandomUtil.produceCode());
    }
}
